package com.guanyong.dao;

import com.guanyong.model.AdvertisementModel;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by mxk on 2017/6/3.
 */
public interface IAdvertisementDaoMapper {

    @Select("select * from t_ad_advertisement where f_id=#{id}")
    @ResultMap("AdvertisementResultMap")
    AdvertisementModel GetAdvertisementModelById(Integer id);


    List<AdvertisementModel>  SelectAdList(@Param(value = "type") Integer type,
                                           @Param(value = "offset") Integer offset,
                                           @Param(value = "limit") Integer limit);

    Integer SelectAdListCount(@Param(value = "type") Integer type);

    int insert(@Param(value = "record") AdvertisementModel record);

    int update(@Param(value = "record") AdvertisementModel record);

    @Delete(" DELETE FROM `t_ad_advertisement` WHERE f_id=#{id} ")
    int delete(@Param(value = "id") Integer id);
}
